package com.score.system.entity;

import org.springframework.util.comparator.ComparableComparator;

public class Score implements Comparable<Score> {
    private int sid;
    private int cid;
    private String coursename;
    private  int score;

    public int getSid() {
        return sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    public int getCid() {
        return cid;
    }

    public void setCid(int cid) {
        this.cid = cid;
    }

    public String getCoursename() {
        return coursename;
    }

    public void setCoursename(String coursename) {
        this.coursename = coursename;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Score{" +
                "sid=" + sid +
                ", cid=" + cid +
                ", coursename='" + coursename + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Score o) {
        return o.getScore() - this.getScore();
    }
}
